using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FoundationLib.AddIns.Constraints
{
	/// <summary>
	/// Represents an OCL statement defined on a method
	/// </summary>
	public class MethodOclStatement : OclStatement
	{
		/// <summary>
		/// The constraint type of the method
		/// </summary>
		private MethodConstraintType constraintType;
		/// <summary>
		/// The name of the type returned by the method
		/// </summary>
		private string returnTypeName;
		/// <summary>
		/// A flag indicating whether the method return type is an array
		/// </summary>
		private bool returnIsArray;

		/// <summary>
		/// Gets the name of the type returned by the method
		/// </summary>
		public string ReturnTypeName
		{
			get
			{
				return this.returnTypeName;
			}
		}

		/// <summary>
		/// Gets a value indicating whether the method return type is an array
		/// </summary>
		public bool ReturnIsArray
		{
			get
			{
				return this.returnIsArray;
			}
		}

		/// <summary>
		/// Gets the method constraint type
		/// </summary>
		public MethodConstraintType ConstraintType
		{
			get
			{
				return this.constraintType;
			}
		}

		/// <summary>
		/// Creates a new method OCL statement
		/// </summary>
		/// <param name="value">The OCL statement value</param>
		/// <param name="name">The OCL statement name</param>
		/// <param name="type">The method constraint type</param>
		/// <param name="returnTypeName">The name of the type returned by the
		/// method</param>
		/// <param name="returnIsArray">A flag indicating whether the method return type is
		/// an array</param>
		public MethodOclStatement(string value, string name, MethodConstraintType type, string returnTypeName, bool returnIsArray)
			: base(value, name)
		{
			this.constraintType = type;
			this.returnIsArray = returnIsArray;
			this.returnTypeName = returnTypeName;
		}
	}
}
